package com.wms.service.Storehouse;

import com.wms.common.PageInfo;
import com.wms.dao.StorehouseMapper;
import com.wms.domain.StorehouseDomain;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class StorehouseImpl implements StorehouseService{

    @Autowired
    StorehouseMapper storehouseMapper;

    @Override
    public Object getStorehousePage(StorehouseDomain storehouseDomain) {
        PageInfo page = new PageInfo();
        List<HashMap<String,Object>> list = storehouseMapper.getStorehousePage(storehouseDomain);
        page.setData(list);
        page.setCount(storehouseDomain.getBaseCount());
        page.setSum(storehouseDomain.getBaseSum());
        return page;
    }

    @Override
    public Object getStorehouseByGid(Long id) {
        return storehouseMapper.getStorehouseByGid(id);
    }
}
